#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    vector<int> twoSum(vector<int>& price, int target)
    {
        int l = 0, r = price.size() - 1;
        while (l < r)
        {
            if (price[l] + price[r] > target) r--;
            else if (price[l] + price[r] < target) l++;
            else break;
        }
        return { price[l], price[r] };
    }
};